import { MyVue } from 'src/wl/my_vue';
import Vue from 'vue';
import { Component, Emit, Prop, Provide, Watch } from 'vue-property-decorator'
import { WebManageConst } from "src/consts/web_manage_const";
@Component({})
export default class AuditTBusinessPanel extends MyVue {
    name: string = 'MemberPanel';
    formData: any;
    footerFlag: boolean = true;
    selection: any[]
    titles: String[]

    beforeCreate(): void {
    }

    initData(that?: any): void {
        that.formData = {}
    }

    mounted(): void {
    }

    editPassWord(): void {
        this.$refs.webMReSetForm.validate((valid: Boolean) => {
            if (valid) {
                if (this.formData.new === this.formData.again) {
                    var list = WLStore().state.webMReSet.idArr
                    for (let i = 0; i < list.length; i++) {
                        var sendData: any = {}
                        sendData.id = list[i]
                        sendData.password = this.formData.again
                        if (i == list.length - 1) {
                            sendData.lastFlag = true
                        } else {
                            sendData.lastFlag = false
                        }
                        WLDispatch(WebManageConst.DispatchWebMReset, sendData)
                    }
                } else {
                    WLMessage("两次输入的密码不一致，请重新输入", "warning")
                }
            } else {
                WLMessage("必填字段为空,无法修改密码", "warning")
                return false;
            }
        })
    }

    change(val: any): void {
        this.selection = val
    }
}